package test.library.behavior;

import test.library.Book;
import test.library.BookList;

import java.util.Scanner;

public class BorrowBook implements IBehavior{
    public void work(BookList bookList){
        System.out.println("借阅书籍");
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入书籍编号:");
        int num = scanner.nextInt();
        Book book = bookList.getBook(num);
        book.setBorrowed(true);
        System.out.println("已借出");
    }
}
